import type { RouteRecordRaw } from 'vue-router'

export const Layout = () => import('@/layout/index.vue')
export const Login = () => import('@/views/login/index.vue')
export const layoutRoute = {
	path: '/',
	name: 'layout',
	component: Layout,
	redirect: '/home/index',
	children: [
		// {
		// 	path: 'home',
		// 	meta: { title: 'home', icon: 'homepage', affix: true },
		// 	component: () => import('@/views/dashboard/index.vue'),
		// },
	],
}

// 静态路由
const constantRoutes: RouteRecordRaw[] = [
	// {
	// 	path: '/redirect',
	// 	component: Layout,
	// 	meta: { hidden: true },
	// 	children: [
	// 		{
	// 			path: '/redirect/:path(.*)',
	// 			component: () => import('@/views/redirect/index.vue'),
	// 		},
	// 	],
	// },
	layoutRoute,
	{
		path: '/login',
		meta: { hidden: true },
		component: () => import('@/views/login/index.vue'),
	},
	// {
	// 	path: '/home',
	// 	component: Layout,
	// 	redirect: '/home/index',
	// 	children: [
	// 		{
	// 			path: 'index',
	// 			meta: { title: 'homeIndex', icon: 'homepage', affix: true },
	// 			component: () => import('@/views/dashboard/index.vue'),
	// 		},
	// 	],
	// },
	{
		path: '/:pathMatch(.*)*',
		meta: { hidden: true, title: '404页面' },
		component: () => import('@/views/errorPage/404.vue'), // 修复了路径
	},
]

export { constantRoutes }
